<template>
	<view style="display: flex;flex-wrap: wrap;"
	:style="{
		'width': nodeModel.configDict.componentStyle.width+'rpx',
	    'background': nodeModel.configDict.componentStyle.background,
		'flex-direction': nodeModel.configDict.componentStyle.flex_direction,
		'justify-content': nodeModel.configDict.componentStyle.justify_content,
		'align-items': nodeModel.configDict.componentStyle.align_items,
		'marginTop': nodeModel.configDict.componentStyle.marginTop+'rpx',
		'marginBottom': nodeModel.configDict.componentStyle.marginBottom+'rpx',
		'marginLeft': nodeModel.configDict.componentStyle.marginLeft+'rpx',
		'marginRight': nodeModel.configDict.componentStyle.marginRight+'rpx',
		'paddingTop': nodeModel.configDict.componentStyle.paddingTop+'rpx',
		'paddingBottom': nodeModel.configDict.componentStyle.paddingBottom+'rpx',
		'paddingLeft': nodeModel.configDict.componentStyle.paddingLeft+'rpx',
		'paddingRight': nodeModel.configDict.componentStyle.paddingRight+'rpx'
		}">
		<map id="map" @click="openMap" :show-location="true" :latitude="nodeModel.configDict.itemStyle.latitude" :longitude="nodeModel.configDict.itemStyle.longitude"
		:style="{
			'width': nodeModel.configDict.itemStyle.width+'rpx',
			'height': nodeModel.configDict.itemStyle.height+'rpx',
			'border-radius': nodeModel.configDict.componentStyle.borderRadiusForCover1+'rpx',
			}"></map>
	</view>

</template>

<script>
	export default{
		props: {
			nodeModel: {
				type: Object,
				default: {}
			}
		},
		data() {
			return {
			}
		},
		methods:{
			itemHandle(e){
				this.$emit('itemHandle', e)
			},
			openMap(){
				uni.openLocation({
					latitude: parseFloat(this.nodeModel.configDict.itemStyle.latitude),
					longitude: parseFloat(this.nodeModel.configDict.itemStyle.longitude),
					success: function () {
						// console.log('success');
					}
				});
			},
		}
	}
</script>

<style>
</style>
